﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConferenceSystem
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("*******************");
            Console.WriteLine("");
            Console.WriteLine("第一部分：中介者模式");
            cl_0423_AbstractSyatem _AbstractSyatem = new cl_0423_Administrator();
            cl_0423_RelatedEmployees employee1, employee2;
            
            employee1 = new cl_0423_Employee("小红");
            employee2 = new cl_0423_Employee("小白");

            _AbstractSyatem.On_duty(employee1);
            _AbstractSyatem.On_duty(employee2);

            employee1.Work_Overtime();
            employee2.Work_Overtime();
            Console.WriteLine("");
            Console.WriteLine("*******************");
            Console.WriteLine("");
            Console.WriteLine("第二部分：观察者模式");
            cl_0423_SystemSubject subject = new cl_0423_Department("人力部");
            cl_0423_EmployeeObserver ob1, ob2, ob3;
            ob1 = new cl_0423_Employee("李四");
            ob2 = new cl_0423_Employee("张三");
            ob3 = new cl_0423_Employee("王五");

            subject.attach(ob1);
            subject.attach(ob2);
            subject.attach(ob3);

            subject.notice();


            Console.WriteLine("");
            Console.WriteLine("*******************");
            Console.WriteLine("");
            Console.WriteLine("第三部分：观察者模式");
            cl_0423_System system = new cl_0423_MeetingList();
            cl_0423_MeetingObserver mob1, mob2, mob3, mob4;

            mob1 = new cl_0423_Employee("火娃");
            mob2 = new cl_0423_Department("人力部");
            mob3 = new cl_0423_Employee("水娃");
            mob4 = new cl_0423_Employee("土娃");

            system.attach(mob1);
            system.attach(mob2);
            system.attach(mob3);
            system.attach(mob4);

            system.Message();
            Console.ReadKey();

        }
    }
}
